package com.bwie.task;

import com.bwie.mapper.TbProdMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author 牛毅
 * @version 1.0
 * @date 2025/7/23
 * @description TODO
 */
@Component

public class ProdTask {

    @Autowired
    TbProdMapper tbProdMapper;

    /**
     * @description: 设置定时任务修改上架状态
     * @param:
     * @return: void
     * @author 牛毅
     * @date: 2025/7/23 9:14
     */
    @Scheduled(cron = "0 */1 * * * ?")
    public void taskUpTime(){
        System.out.println("开始定时任务");
        tbProdMapper.taskUploadprod();
        System.out.println("结束定时任务");
    }
    /**
     * @description: 设置定时任务修改下架状态
     * @param:
     * @return: void
     * @author 牛毅
     * @date: 2025/7/23 9:14
     */
    @Scheduled(cron = "0 */1 * * * ?")
    public void taskDownTime(){
        System.out.println("开始定时任务");
        tbProdMapper.taskOffUploadprod();
        System.out.println("结束定时任务");
    }
}
